Command Line and Scripting

PreviousUpNext

Program Executable Files

As you would expect, Beyond Compare's setup program creates shortcuts to the main executable file, such as:

C:\Program Files\Beyond Compare 3\BCompare.exe

However, if you call Beyond Compare from a batch file or a version control system, you may want to call our BComp launcher program instead of calling BCompare directly.  Here is a discussion of the differences between them:

BCompare.exe is the main application and only one copy will run at a time, regardless of how many windows you have open.  If you launch a second copy it will tell the existing copy to start a comparison and exit immediately.

BComp.exe and BComp.com are two versions of the launcher program that will launch a BC comparison and wait for the comparison result before exiting.  Use them anywhere where you need that behavior (version control merges, batch files, etc.).

BComp.exe is a Win32 GUI program.  If launched from a version control system it should work just fine.  If launched from a console window the console (or batch file) will not wait for it.

BComp.com is a Win32 console program.  It has to have a console; if you launch it from one (or a batch file) that console will wait for the comparison to complete before returning.  If you launch it from a version control system interactively, it will show a console window while it's waiting.

Generally you should just use BComp and let Windows figure out which to use.  If you have to include an extension you should generally use BComp.exe.  If it doesn't matter whether or not it waits, you can continue using BCompare.exe.

Command Line Parameters

You can add parameters to the command line of your Beyond Compare shortcuts to change how the program starts up or to execute a script.

Parameter

Meaning

Named Session

Opens the specified session in the appropriate view.
(eg. BCompare.exe "MySession")

Pair of folders

Opens a new Folder Compare session with the specified base folders using the default session settings.
(eg. BCompare.exe C:\Folder1 C:\Folder2)

Pair of files

Opens the specified files in the associated file view.
(eg. BCompare.exe C:\File1.ext C:\Filer2.ext)

Script file

Automatically executes a list of commands without using a view.
(eg. BCompare.exe @C:\Script.txt)